<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;

/**
 * 路由
 */

Route::get('api/:version/banner/:id','api/:version.Banner/getBanner');//获取banner图
Route::get('api/:version/getMessage/:id', 'api/:version.Banner/getMessage');
Route::get('api/:version/theme', 'api/:version.Theme/getSimpleList');//获取所有主题
Route::get('api/:version/theme/:id', 'api/:version.Theme/getComplexOne');//获取某一个主题的信息
Route::group('api/:version/product', function() {
    Route::get('/:id', 'api/:version.Product/getOne', [], ['id' => '\d+']);//获取某一个商品的信息
    Route::get('/recent', 'api/:version.product/getRecent');//获取最新商品
    Route::get('/by_category', 'api/:version.Product/getCategoryProducts');//获取分类的商品
});
Route::post('api/:version/address', 'api/:version.Address/createOrUpdateAddress');//地址的添加和更新
Route::get('api/:version/address/hello', 'api/:version.Address/hello');//前置方法试验
Route::get('api/:version/category/all', 'api/:version.Category/getCategorys');//获取所有的分类
Route::post('api/:version/token/user', 'api/:version.Token/getToken');//通过code获取token

Route::post('api/:version/order', 'api/:version.Order/placeOrder');//下定单的方法
Route::post('api/:version/pay/pre_order', 'api/:version.Pay/getPreOrder');